<template>
  <div class="logo">
    <router-link :to="{name:'Console'}">
      <!--      <LogoSvg alt="logo" />-->
<!--            <h1 class="title" v-if="showTitle">{{ this.titles }}</h1>-->
      <img src="~@/assets/img/logo_img_gongye.png">
    </router-link>
  </div>
</template>

<script>
import LogoSvg from '@/assets/logo.svg?inline'
import { mixin, mixinDevice } from '@/utils/mixin'

export default {
  name: 'Logo',
  components: {
    LogoSvg
  },
  mixins: [mixin, mixinDevice],
  data () {
    return {
      titles: ''
    }
  },
  props: {
    title: {
      type: String,
      default: '工业声振监控系统 V3.0',
      required: false
    },
    showTitle: {
      type: Boolean,
      default: true,
      required: false
    }
  },
  created () {
    if (this.layoutMode === 'topmenu') {
      if (this.title.length > 8) {
        this.titles = this.title.substring(0, 7) + '...'
      } else {
        this.titles = this.title
      }
    } else {
      if (this.title.length > 14) {
        this.titles = this.title.substring(0, 14) + '...'
      } else {
        this.titles = this.title
      }
    }
  }
}
</script>
